package com.dubbo.framework.protocol.http;

import com.dubbo.framework.Invocation;
import com.dubbo.framework.URL;
import com.dubbo.framework.protocol.Protocol;

/**
 * @author by Mr. Li 2021/4/30 14:16
 */
public class HttpProtocol implements Protocol {
    @Override
    public void start(URL url) {
        HttpServer httpServer = new HttpServer();
        httpServer.start(url.getIpAddr(), url.getPort());
    }

    @Override
    public String send(URL url, Invocation invocation) {
        HttpClient httpClient = new HttpClient();
        return httpClient.send(url.getIpAddr(), url.getPort(), invocation);
    }
}
